package cn.cdutetc.library.entity.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * 用户更新DTO
 */
@Data
public class UserUpdateDTO {
    private Integer userId;
    
    @Length(min = 3, max = 20, message = "用户名长度必须在3-20个字符之间")
    private String username;
    
    private String realName;
    
    private String role;
    
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;
    
    @Email(message = "邮箱格式不正确")
    private String email;
    
    private String status;
    
    @Override
    public String toString() {
        return "UserUpdateDTO{userId=" + userId + ", username='" + username + "', realName='" + realName + "', role='" + role + "'}";
    }
}